<?php
/**
 * Event Books
 * User: zng
 * Date: 2020/1/13
 * Time: 17:00
 */
namespace app\admin\event\erm;

use think\facade\Cache;

Class Sidebar {

    /**
     * 新增后
     * @param \app\admin\model\erm\Sidebar $model
     */
    public function afterInsert( $model )
    {
        $cacheKey = 'api_sidebar_list'.date("Ymd");
        Cache::rm($cacheKey);
    }

    /**
     * 更新后
     * @param \app\admin\model\erm\Sidebar $model
     */
    public function afterUpdate( $model )
    {
        $cacheKey = 'api_sidebar_list'.date("Ymd");
        Cache::rm($cacheKey);
    }

    /**
     * 写入后
     * @param \app\admin\model\erm\Sidebar $model
     */
    public function afterWrite( $model )
    {
        $cacheKey = 'api_sidebar_list'.date("Ymd");
        Cache::rm($cacheKey);
    }

    /**
     * 删除后
     * @param \app\admin\model\erm\Sidebar $model
     */
    public function afterDelete( $model )
    {
        $cacheKey = 'api_sidebar_list'.date("Ymd");
        Cache::rm($cacheKey);
    }

}